package com.dq.domain.setup;

import com.dq.vo.baseVo.VO;
import com.dq.domain.base.BaseEntity;
import com.dq.utils.TimeUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Entity;

/**
 * @Author luchangtong
 * @Date 2019/11/23 17:46
 */
@Data
@Entity
@ApiModel("广告位")
public class Advertising extends BaseEntity implements VO.ToVO{
    @ApiModelProperty("广告图")
    protected String imgUrl;
    @ApiModelProperty("广告内容")
    protected String adContent;
    @ApiModelProperty("广告详情")
    protected String adDesc;

    @Data
    @ApiModel(value = "返佣设置视图")
    public static class Vo implements VO {
        protected Long id;
        @ApiModelProperty("广告图")
        protected String imgUrl;
        @ApiModelProperty("广告内容")
        protected String adContent;
        @ApiModelProperty("广告详情")
        protected String adDesc;
        protected String createTime;
    }
    @Override
    public VO toVO(boolean isRecursion) {
        Vo vo = new Vo();
        vo.id = this.getId();
        vo.imgUrl = this.getImgUrl();
        vo.adContent = this.getAdContent();
        vo.adDesc =this.getAdDesc();
        vo.createTime=fmt(this.getCreateTime(), TimeUtil.YYYY_MM_DD_HH_MM_SS);
        return vo;
    }
}
